import jdk.internal.org.objectweb.asm.tree.ClassNode;

import java.sql.*;

public class jdbcTest {
    public static void main(String[] args) throws ClassNotFoundException, SQLException {
        Class.forName("com.mysql.cj.jdbc.Driver");
        String  url="jdbc:mysql://localhost:3306/root?useUnicode=true&characterEncoding=utf8&useSSL=true";
        String name="root";
        String password ="SkaEgfPsal/p";
        Connection connection = DriverManager.getConnection(url, name, password);

        Statement statement = connection.createStatement();
        String sql="SELECT * FROM class";
        ResultSet resultSet = statement.executeQuery(sql);
        while (resultSet.next()){
            String name1 =(String)resultSet.getObject("name");
            System.out.println("同学的名字是"+name1);

        }
}}

